package com.xiangban.xiangbanmall.controller;

import com.xiangban.xiangbanmall.aop.Permission;
import com.xiangban.xiangbanmall.model.TUserMember;
import com.xiangban.xiangbanmall.model.TUserWalletRecord;
import com.xiangban.xiangbanmall.model.res.ApiResult;
import com.xiangban.xiangbanmall.service.BillService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Mr. MaYaYun
 * @Data 2021/11/1 15:45
 */
@RestController
@RequestMapping("/api/mall/bill")
@Api(tags = "账单信息管理")
public class BillController {
    @Autowired
    private BillService billService;


    @RequestMapping("/add_user_wallet_record")
    @ApiOperation("添加消费明细")
    @Permission
    public ApiResult<Object> addUserWalletRecord(@RequestBody TUserWalletRecord tUserWalletRecord){
        billService.addUserWalletRecord(tUserWalletRecord);
        return ApiResult.newSuccess();
    }

    @RequestMapping("/get_user_wallet_record")
    @ApiOperation("获取消费明细")
    @Permission
    public ApiResult<Object> getUserWalletRecord(){
        return ApiResult.newSuccess(billService.getUserWalletRecord());
    }

}
